<template>
  <vxe-input
    v-model="actualValue"
    suffix-icon="el-icon-search"
    placeholder="快速查询"
    @keyup.enter.native="query"
    clearable
  ></vxe-input>
</template>

<script>
export default {
  props: {
    //queryEntity查询实体
    value: {
      type: String,
      default: '',
    }
  },
  computed:{
  },
  watch:{
    value(newVal, oldVal) {
      this.actualValue = newVal;
      if(!newVal){
        this.$emit(`query`);
      }
    },
    actualValue(newVal, oldVal) {
      if (newVal !== oldVal) {
        this.$emit("input", newVal);
      }
    },
  },
  data() {
    return {
      actualValue: this.value,
    };
  },
  methods:{
    query(){
      this.$emit(`query`);
    }
  }
};
</script>

<style lang="less" scoped>

</style>